//
//  LLTest.m
//  LLTryFightingApp
//
//  Created by jinbang.li on 2024/9/24.
//

#import "LLTest.h"
#include "Array.hpp"
#include "Deque.hpp"
@implementation LLTest
/**
 测试方法
 */
- (void)testMethod{
    NSLog(@"testMethod");
    
    ///椎区调用
    LLArray *la = new LLArray();
    la->test();
    delete la;
    
    //栈区调用
    LLArray la2;
    la2.test();
    
    //自定义数组的调用
    LLDynamicArray ld;
    ld.push_back(1);
    ld.push_back(2);
    for (size_t i = 0; i < ld.getSize(); i++) {
         std::cout << ld[i] << " "; // 访问数组元素
     }
     std::cout << std::endl;
    
    
    ///基于双链表实现的双端队列
    LLDeque<int> deque;
    deque.pushBack(1);
    deque.pushBack(2);
    deque.pushFront(0);
    deque.display();
    
    deque.popFront();
    deque.display();
    
    deque.popBack();
    deque.display();
}
@end
